const GET_DATA = 'GET_DATA'
const CHANGE_BOX = 'CHANGE_BOX'
const INIT_BOX = 'INIT_BOX'
const CHANGE_LOADING = 'CHANGE_LOADING'
const PRIZE_DETAIL = 'PRIZE_DETAIL'
const SCORE = 'SCORE'
const CANLOTTERY = 'CANLOTTERY'

export default {
	[CHANGE_BOX](state, payload){
		state.box[payload.key] = payload.value; 
	},
	[INIT_BOX](state, payload) {
		for(let key in state.box){
			state.box[key] = false;
		}
	},
	[CHANGE_LOADING](state, payload){
		state.loadingType = payload.type;
	},
	[PRIZE_DETAIL](state, payload) {
		state.prize = Object.assign(state.prize, payload);
	},
	[SCORE](state, payload) {
		state.score = Object.assign(state.score, payload);
	},
	[CANLOTTERY](state, payload){
		state.canLottery = payload.canLottery
	}
}